import VueRouter from 'vue-router'
//引入组件
import Index from '../pages'
import Home from '../pages/home/home'
import Login from '../pages/login/login'
import Register from '../pages/register/register'
import Center from '../pages/center/center'
import Storeup from '../pages/storeup/list'
import payList from '../pages/pay'

import jianceyuanList from '../pages/jianceyuan/list'
import jianceyuanDetail from '../pages/jianceyuan/detail'
import jianceyuanAdd from '../pages/jianceyuan/add'
import jishurenyuanList from '../pages/jishurenyuan/list'
import jishurenyuanDetail from '../pages/jishurenyuan/detail'
import jishurenyuanAdd from '../pages/jishurenyuan/add'
import bumenList from '../pages/bumen/list'
import bumenDetail from '../pages/bumen/detail'
import bumenAdd from '../pages/bumen/add'
import gangweiList from '../pages/gangwei/list'
import gangweiDetail from '../pages/gangwei/detail'
import gangweiAdd from '../pages/gangwei/add'
import shebeileixingList from '../pages/shebeileixing/list'
import shebeileixingDetail from '../pages/shebeileixing/detail'
import shebeileixingAdd from '../pages/shebeileixing/add'
import shebeixinxiList from '../pages/shebeixinxi/list'
import shebeixinxiDetail from '../pages/shebeixinxi/detail'
import shebeixinxiAdd from '../pages/shebeixinxi/add'
import jiancebaogaoList from '../pages/jiancebaogao/list'
import jiancebaogaoDetail from '../pages/jiancebaogao/detail'
import jiancebaogaoAdd from '../pages/jiancebaogao/add'
import shebeibaoxiuList from '../pages/shebeibaoxiu/list'
import shebeibaoxiuDetail from '../pages/shebeibaoxiu/detail'
import shebeibaoxiuAdd from '../pages/shebeibaoxiu/add'
import weixiurenwuList from '../pages/weixiurenwu/list'
import weixiurenwuDetail from '../pages/weixiurenwu/detail'
import weixiurenwuAdd from '../pages/weixiurenwu/add'
import baoxiuchuliList from '../pages/baoxiuchuli/list'
import baoxiuchuliDetail from '../pages/baoxiuchuli/detail'
import baoxiuchuliAdd from '../pages/baoxiuchuli/add'
import diannengzhiliangList from '../pages/diannengzhiliang/list'
import diannengzhiliangDetail from '../pages/diannengzhiliang/detail'
import diannengzhiliangAdd from '../pages/diannengzhiliang/add'
import gonggaoxinxiList from '../pages/gonggaoxinxi/list'
import gonggaoxinxiDetail from '../pages/gonggaoxinxi/detail'
import gonggaoxinxiAdd from '../pages/gonggaoxinxi/add'
import gonggaofenleiList from '../pages/gonggaofenlei/list'
import gonggaofenleiDetail from '../pages/gonggaofenlei/detail'
import gonggaofenleiAdd from '../pages/gonggaofenlei/add'
import chatmessageList from '../pages/chatmessage/list'
import chatmessageDetail from '../pages/chatmessage/detail'
import chatmessageAdd from '../pages/chatmessage/add'
import friendList from '../pages/friend/list'
import friendDetail from '../pages/friend/detail'
import friendAdd from '../pages/friend/add'
import syslogList from '../pages/syslog/list'
import syslogDetail from '../pages/syslog/detail'
import syslogAdd from '../pages/syslog/add'
import smsregistercodeList from '../pages/smsregistercode/list'
import smsregistercodeDetail from '../pages/smsregistercode/detail'
import smsregistercodeAdd from '../pages/smsregistercode/add'

const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
	return originalPush.call(this, location).catch(err => err)
}

//配置路由
export default new VueRouter({
	routes:[
		{
      path: '/',
      redirect: '/index/home'
    },
		{
			path: '/index',
			component: Index,
			children:[
				{
					path: 'home',
					component: Home
				},
				{
					path: 'center',
					component: Center,
				},
				{
					path: 'pay',
					component: payList,
				},
				{
					path: 'storeup',
					component: Storeup
				},
				{
					path: 'jianceyuan',
					component: jianceyuanList
				},
				{
					path: 'jianceyuanDetail',
					component: jianceyuanDetail
				},
				{
					path: 'jianceyuanAdd',
					component: jianceyuanAdd
				},
				{
					path: 'jishurenyuan',
					component: jishurenyuanList
				},
				{
					path: 'jishurenyuanDetail',
					component: jishurenyuanDetail
				},
				{
					path: 'jishurenyuanAdd',
					component: jishurenyuanAdd
				},
				{
					path: 'bumen',
					component: bumenList
				},
				{
					path: 'bumenDetail',
					component: bumenDetail
				},
				{
					path: 'bumenAdd',
					component: bumenAdd
				},
				{
					path: 'gangwei',
					component: gangweiList
				},
				{
					path: 'gangweiDetail',
					component: gangweiDetail
				},
				{
					path: 'gangweiAdd',
					component: gangweiAdd
				},
				{
					path: 'shebeileixing',
					component: shebeileixingList
				},
				{
					path: 'shebeileixingDetail',
					component: shebeileixingDetail
				},
				{
					path: 'shebeileixingAdd',
					component: shebeileixingAdd
				},
				{
					path: 'shebeixinxi',
					component: shebeixinxiList
				},
				{
					path: 'shebeixinxiDetail',
					component: shebeixinxiDetail
				},
				{
					path: 'shebeixinxiAdd',
					component: shebeixinxiAdd
				},
				{
					path: 'jiancebaogao',
					component: jiancebaogaoList
				},
				{
					path: 'jiancebaogaoDetail',
					component: jiancebaogaoDetail
				},
				{
					path: 'jiancebaogaoAdd',
					component: jiancebaogaoAdd
				},
				{
					path: 'shebeibaoxiu',
					component: shebeibaoxiuList
				},
				{
					path: 'shebeibaoxiuDetail',
					component: shebeibaoxiuDetail
				},
				{
					path: 'shebeibaoxiuAdd',
					component: shebeibaoxiuAdd
				},
				{
					path: 'weixiurenwu',
					component: weixiurenwuList
				},
				{
					path: 'weixiurenwuDetail',
					component: weixiurenwuDetail
				},
				{
					path: 'weixiurenwuAdd',
					component: weixiurenwuAdd
				},
				{
					path: 'baoxiuchuli',
					component: baoxiuchuliList
				},
				{
					path: 'baoxiuchuliDetail',
					component: baoxiuchuliDetail
				},
				{
					path: 'baoxiuchuliAdd',
					component: baoxiuchuliAdd
				},
				{
					path: 'diannengzhiliang',
					component: diannengzhiliangList
				},
				{
					path: 'diannengzhiliangDetail',
					component: diannengzhiliangDetail
				},
				{
					path: 'diannengzhiliangAdd',
					component: diannengzhiliangAdd
				},
				{
					path: 'gonggaoxinxi',
					component: gonggaoxinxiList
				},
				{
					path: 'gonggaoxinxiDetail',
					component: gonggaoxinxiDetail
				},
				{
					path: 'gonggaoxinxiAdd',
					component: gonggaoxinxiAdd
				},
				{
					path: 'gonggaofenlei',
					component: gonggaofenleiList
				},
				{
					path: 'gonggaofenleiDetail',
					component: gonggaofenleiDetail
				},
				{
					path: 'gonggaofenleiAdd',
					component: gonggaofenleiAdd
				},
				{
					path: 'chatmessage',
					component: chatmessageList
				},
				{
					path: 'chatmessageDetail',
					component: chatmessageDetail
				},
				{
					path: 'chatmessageAdd',
					component: chatmessageAdd
				},
				{
					path: 'friend',
					component: friendList
				},
				{
					path: 'friendDetail',
					component: friendDetail
				},
				{
					path: 'friendAdd',
					component: friendAdd
				},
				{
					path: 'syslog',
					component: syslogList
				},
				{
					path: 'syslogDetail',
					component: syslogDetail
				},
				{
					path: 'syslogAdd',
					component: syslogAdd
				},
				{
					path: 'smsregistercode',
					component: smsregistercodeList
				},
				{
					path: 'smsregistercodeDetail',
					component: smsregistercodeDetail
				},
				{
					path: 'smsregistercodeAdd',
					component: smsregistercodeAdd
				},
			]
		},
		{
			path: '/login',
			component: Login
		},
		{
			path: '/register',
			component: Register
		},
	]
})
